package org.chimi.rr4s.rest;

import java.util.ArrayList;
import java.util.List;

import org.chimi.rr4s.domain.ItemResult;

/**
 * 
 * @author Choi, Beom Kyun
 * 
 */
public class RecommendItemResult {

	private boolean success;
	private List<RecommendItem> items;

	public RecommendItemResult(List<ItemResult> itemResults) {
		items = new ArrayList<RecommendItemResult.RecommendItem>();
		for (ItemResult result : itemResults) {
			items.add(new RecommendItem(result.getItem().getId(), result
					.getItem().getType(), result.getCount()));
		}
	}

	public boolean isSuccess() {
		return success;
	}

	public List<RecommendItem> getItems() {
		return items;
	}

	public static class RecommendItem {
		private String itemId;
		private String itemType;
		private int count;

		public RecommendItem(String itemId, String itemType, int count) {
			this.itemId = itemId;
			this.itemType = itemType;
			this.count = count;
		}

		public String getItemId() {
			return itemId;
		}

		public String getItemType() {
			return itemType;
		}

		public int getCount() {
			return count;
		}
	}
}
